package com.tancire.net.utils;

import com.tancire.common.core.redis.RedisCache;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class SysConfigUtils {

    @Resource
    private RedisCache redisCache;

    /**
     * 根据key 获取系统配置
     *
     * @param key
     * @return
     */
    public String getConfigString(String key) {
        try {
            return redisCache.getCacheObject("sys_config:" + key);
        } catch (Exception e) {
            // 不处理
        }
        return null;
    }
}
